//// demo_prog/chapter4/demo4_8_2.c
// 例4.8 第二种解法: 在else部分嵌套
#include <stdio.h>

int main(void) 
{
  int year, leap;
  scanf("%d", &year);

  if (year % 4 != 0)
  {
    leap = 0;
  }
  else if (year % 100 != 0) //能被4整除、不能被100整除
  {
    leap = 1;
  }
  else if (year % 400 != 0) // 能被4整除、能被100整除、不能被400整除
  {
    leap = 0;
  }
  else // 能被4、100和400整除
  {
    leap = 1;
  }
  if (leap)
  {
    printf("%d is ", year);
  }
  else
  {
    printf("%d is not ", year);
  }
  printf("a leap year.\n");
  return 0;
}